<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bai 2.27</title>
</head>

<body>
<?php
	if(isset($_POST['str1']) && isset($_POST['str2']))
	{
		$str1=$_POST['str1'];
		$str2=$_POST['str2'];
		$pos = strcmp($str1,$str2);
		$kq=$pos<>0?($pos>0?"Chuỗi thứ nhất dài hơn chuỗi thứ hai":"Chuỗi thứ nhất ngắn hơn chuỗi thứ hai"):"Hai chuỗi bằng nhau";
	}
?>
<form id="form1" name="form1" method="post" action="Bai2_27.php">
  <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="2" bgcolor="#FFCCFF" style="text-align: center; font-weight: bold; font-style: italic; font-size: 24px; color: #F00;">SO SÁNH CHUỖI</td>
    </tr>
    <tr>
      <td nowrap="nowrap" bgcolor="#66FFFF">Chuỗi thứ nhất:</td>
      <td nowrap="nowrap" bgcolor="#66FFFF"><input name="str1" type="text" id="str1" value="<?php echo $_POST['str1'];?>" size="50" /></td>
    </tr>
    <tr>
      <td nowrap="nowrap" bgcolor="#66FFFF">Chuỗi thứ hai:</td>
      <td nowrap="nowrap" bgcolor="#66FFFF"><input name="str2" type="text" id="str2" value="<?php echo $_POST['str2'];?>" size="50" /></td>
    </tr>
    <tr style="text-align: center; color: #366;">
      <td colspan="2" bgcolor="#66FFFF"><input style="background-color:#366" type="submit" name="submit" id="submit" value="So sánh" /></td>
    </tr>
    <tr>
      <td bgcolor="#66FFFF">&nbsp;</td>
      <td bgcolor="#66FFFF"><input name="kq" type="text" disabled="disabled" id="kq" style="background-color:#FFC; color:#F00; font-weight:bold" value="<?php echo $kq;?>" size="50" /></td>
    </tr>
  </table>
</form>
</body>
</html>